package action;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.json.annotations.JSON;

import com.opensymphony.xwork2.ActionSupport;

import db.UserVo;

@SuppressWarnings("serial")
public class Login extends ActionSupport {

	public String name;

	public String pass;

	public String Altitude;

	public String Latitude;
	
	public String type;
	
	public List<UserVo> list;
	
	public List<Userinfo> lists;
   
	public List<Userinfo> getLists() {
		return lists;
	}

	public void setLists(List<Userinfo> lists) {
		this.lists = lists;
	}

	public List<UserVo> getList() {
		return list;
	}

	public void setList(List<UserVo> list) {
		this.list = list;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@JSON(serialize=false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
     
	@JSON(serialize=false)
	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}
    
	@JSON(serialize=false)
	public String getAltitude() {
		return Altitude;
	}

	public void setAltitude(String altitude) {
		Altitude = altitude;
	}
    
	@JSON(serialize=false)
	public String getLatitude() {
		return Latitude;
	}

	public void setLatitude(String latitude) {
		Latitude = latitude;
	}

	public String ckecklogin() {
		
		System.out.println(name);
		System.out.println(Altitude);
		System.out.println(Latitude);
		List<UserVo> listsb=new ArrayList<UserVo>();
		List<Userinfo> listss=new ArrayList<Userinfo>();
		for(int i=0;i<10;i++){
			UserVo user=new UserVo();
			user.setName("wang"+i);
			user.setPass(i+"");
			user.setAdds("重庆"+i);
			user.setPhone("12735636"+i);
			user.setNumber(i+"");
			
			listsb.add(user);
			for(int k=0;k<5;k++){
				Userinfo u=new Userinfo();
				u.setMoney(100*Math.random()+"");
				u.setNumber(i);
				u.setName("第"+k+"月");
				listss.add(u);
			}
			
			
		}
		this.list=listsb;
		this.lists=listss;
		this.type="success";
		return SUCCESS;
	}
}
